import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import TypeNav from '@/components/TypeNav'
import Pagination from '@/components/Pagination'
import Dialog from '@/components/Dialog'

// 启动mock服务器  只要将mockServer/index.js文件引入过来即可
import '@/mockServer'

// 统一引入轮播图的样式 因为轮播图好几个地方会用到
import 'swiper/css/swiper.css'

//将图片懒加载的组件引入到项目中的 main.js文件中,
import VueLazyload from 'vue-lazyload'

import load from '@/assets/aa.webp'

//使用图片懒加载
Vue.use(VueLazyload, {
  loading: load
})

// 注册为全局组件
Vue.component(TypeNav.name, TypeNav)
Vue.component(Dialog.name, Dialog)

// 将Pagination分页器组件注册为全局组件
Vue.component(Pagination.name, Pagination)
Vue.config.productionTip = false

new Vue({
  render: (h) => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this
  },
  router,
  store
}).$mount('#app')
